package com.czl.module_storehouse.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.czl.base.data.bean.tengyun.ProductBean;
import com.czl.base.data.bean.tengyun.SortBean;

import java.util.List;

public class AllocateBean implements Parcelable {
    private int aduitStatus;
    private String applyComment;
    private int applyCompanyId;
    private String applyCompanyName;
    private String applyCompanyShortName;
    private String applyPersonDepartment;
    private int applyPersonId;
    private String applyPersonName;
    private int inStorehouseId;
    private String moveCode;
    private String moveName;
    private String moveCompanyName;
    private String inStorehouseName;
    private String moveStorehouseName;
    private String moveComment;
    private String inComment;
    private int moveId;
    private int moveStorehouseId;
    private boolean isInCompany;
    private String gmtCreate;
    private String movePersonId;
    private String movePersonName;
    private List<ProductBean> moveProductViewList;
    private List<SortBean> moveSortViewList;
    private List<SortBean> sortList;
    private Boolean isAllComplete;

    protected AllocateBean(Parcel in) {
        aduitStatus = in.readInt();
        applyComment = in.readString();
        applyCompanyId = in.readInt();
        applyCompanyName = in.readString();
        applyCompanyShortName = in.readString();
        applyPersonDepartment = in.readString();
        applyPersonId = in.readInt();
        applyPersonName = in.readString();
        inStorehouseId = in.readInt();
        moveCode = in.readString();
        moveName = in.readString();
        moveCompanyName = in.readString();
        inStorehouseName = in.readString();
        moveStorehouseName = in.readString();
        moveComment = in.readString();
        moveId = in.readInt();
        moveStorehouseId = in.readInt();
        isInCompany = in.readByte() != 0;
        gmtCreate = in.readString();
        movePersonId = in.readString();
        movePersonName = in.readString();
        moveProductViewList = in.createTypedArrayList(ProductBean.CREATOR);
        moveSortViewList = in.createTypedArrayList(SortBean.CREATOR);
        sortList = in.createTypedArrayList(SortBean.CREATOR);
    }

    public static final Creator<AllocateBean> CREATOR = new Creator<AllocateBean>() {
        @Override
        public AllocateBean createFromParcel(Parcel in) {
            return new AllocateBean(in);
        }

        @Override
        public AllocateBean[] newArray(int size) {
            return new AllocateBean[size];
        }
    };

    public String getInComment() {
        return inComment;
    }

    public void setInComment(String inComment) {
        this.inComment = inComment;
    }

    public Boolean getAllComplete() {
        return isAllComplete;
    }

    public boolean getAllCompleteBol() {
        return isAllComplete == null ? false : isAllComplete;
    }

    public void setAllComplete(Boolean allComplete) {
        isAllComplete = allComplete;
    }

    public String getMovePersonId() {
        return movePersonId;
    }

    public void setMovePersonId(String movePersonId) {
        this.movePersonId = movePersonId;
    }

    public String getMovePersonName() {
        return movePersonName;
    }

    public void setMovePersonName(String movePersonName) {
        this.movePersonName = movePersonName;
    }

    public boolean isInCompany() {
        return isInCompany;
    }

    public void setInCompany(boolean inCompany) {
        isInCompany = inCompany;
    }

    public String getMoveCompanyName() {
        return moveCompanyName;
    }

    public void setMoveCompanyName(String moveCompanyName) {
        this.moveCompanyName = moveCompanyName;
    }

    public String getMoveComment(int storehouseId) {
        if (storehouseId == getInStorehouseId()) {
            //入库
            return inComment;
        } else {
            return moveComment;
        }
    }

    public void setMoveComment(String moveComment) {
        this.moveComment = moveComment;
    }

    public String getMoveName() {
        return moveName;
    }

    public void setMoveName(String moveName) {
        this.moveName = moveName;
    }

    public String getInStorehouseName() {
        return inStorehouseName;
    }

    public void setInStorehouseName(String inStorehouseName) {
        this.inStorehouseName = inStorehouseName;
    }

    public String getMoveStorehouseName() {
        return moveStorehouseName;
    }

    public void setMoveStorehouseName(String moveStorehouseName) {
        this.moveStorehouseName = moveStorehouseName;
    }

    public String getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(String gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public int getAduitStatus() {
        return aduitStatus;
    }

    public void setAduitStatus(int aduitStatus) {
        this.aduitStatus = aduitStatus;
    }

    public String getApplyComment() {
        return applyComment;
    }

    public void setApplyComment(String applyComment) {
        this.applyComment = applyComment;
    }

    public int getApplyCompanyId() {
        return applyCompanyId;
    }

    public void setApplyCompanyId(int applyCompanyId) {
        this.applyCompanyId = applyCompanyId;
    }

    public String getApplyCompanyName() {
        return applyCompanyName;
    }

    public void setApplyCompanyName(String applyCompanyName) {
        this.applyCompanyName = applyCompanyName;
    }

    public String getApplyCompanyShortName() {
        return applyCompanyShortName;
    }

    public void setApplyCompanyShortName(String applyCompanyShortName) {
        this.applyCompanyShortName = applyCompanyShortName;
    }

    public String getApplyPersonDepartment() {
        return applyPersonDepartment;
    }

    public void setApplyPersonDepartment(String applyPersonDepartment) {
        this.applyPersonDepartment = applyPersonDepartment;
    }

    public int getApplyPersonId() {
        return applyPersonId;
    }

    public void setApplyPersonId(int applyPersonId) {
        this.applyPersonId = applyPersonId;
    }

    public String getApplyPersonName() {
        return applyPersonName;
    }

    public void setApplyPersonName(String applyPersonName) {
        this.applyPersonName = applyPersonName;
    }

    public int getInStorehouseId() {
        return inStorehouseId;
    }

    public void setInStorehouseId(int inStorehouseId) {
        this.inStorehouseId = inStorehouseId;
    }

    public String getMoveCode() {
        return moveCode;
    }

    public void setMoveCode(String moveCode) {
        this.moveCode = moveCode;
    }

    public int getMoveId() {
        return moveId;
    }

    public void setMoveId(int moveId) {
        this.moveId = moveId;
    }

    public int getMoveStorehouseId() {
        return moveStorehouseId;
    }

    public void setMoveStorehouseId(int moveStorehouseId) {
        this.moveStorehouseId = moveStorehouseId;
    }

    public List<ProductBean> getMoveProductViewList() {
        return moveProductViewList;
    }

    public void setMoveProductViewList(List<ProductBean> moveProductViewList) {
        this.moveProductViewList = moveProductViewList;
    }

    public List<SortBean> getMoveSortViewList() {
        return moveSortViewList;
    }

    public void setMoveSortViewList(List<SortBean> moveSortViewList) {
        this.moveSortViewList = moveSortViewList;
    }

    public List<SortBean> getSortList() {
        return sortList;
    }

    public void setSortList(List<SortBean> sortList) {
        this.sortList = sortList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(aduitStatus);
        dest.writeString(applyComment);
        dest.writeInt(applyCompanyId);
        dest.writeString(applyCompanyName);
        dest.writeString(applyCompanyShortName);
        dest.writeString(applyPersonDepartment);
        dest.writeInt(applyPersonId);
        dest.writeString(applyPersonName);
        dest.writeInt(inStorehouseId);
        dest.writeString(moveCode);
        dest.writeString(moveName);
        dest.writeString(moveCompanyName);
        dest.writeString(inStorehouseName);
        dest.writeString(moveStorehouseName);
        dest.writeString(moveComment);
        dest.writeInt(moveId);
        dest.writeInt(moveStorehouseId);
        dest.writeByte((byte) (isInCompany ? 1 : 0));
        dest.writeString(gmtCreate);
        dest.writeString(movePersonId);
        dest.writeString(movePersonName);
        dest.writeTypedList(moveProductViewList);
        dest.writeTypedList(moveSortViewList);
        dest.writeTypedList(sortList);
    }
}
